<template>
    <div>
        <button @click="isShow = !isShow">切换</button><br/>
        <!-- <transition>
            <h1 v-show="isShow" key="1">你好啊</h1>
            <h1 v-show="!isShow" key="2">长沙</h1>
        </transition> -->

        <transition-group 
            appear
            name="animate__animated animate__bounce"
            enter-active-class="animate__swing"
            leave-active-class="animate__backOutUp"
        >
            <h1 v-show="isShow" key="1">你好啊</h1>
            <h1 v-show="!isShow" key="2">长沙</h1>
        </transition-group>
    </div>
</template>

<script>
export default {
    name: 'HelloWorld',
    data() {
        return {
            isShow: true
        }
    }
}
</script>

<style scoped>
h1{
    background-color: yellowgreen;
}
/* 
div {
    display: flex;
    justify-content: center;
} */

div button {
    display: block;
}

div span {
    background: greenyellow;    
}


@keyframes run-scale {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}
/* 
.run-enter-active {
    animation: run-scale 2s linear 0s;
    animation: lightSpeedInRight 2s linear 0s;
}

.run-leave-active {
    animation: run-scale 2s linear 0s reverse;
    animation: lightSpeedOutRight 2s linear 0s;
} */

/* .run-enter,
.run-leave-to {
    opacity: 0;
}

.run-enter-to,
.run-leave {
    opacity: 1;
}

.run-enter-active,
.run-leave-active {
    transition: 2s linear;
}

.v-enter-active {
    animation: show 0.5s;
    animation-timing-function: linear;
}

.v-leave-active {
    animation: show 0.5s;
    animation-direction: reverse;
    animation-timing-function: linear;
} */

@keyframes show {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0%);
    }
}
</style>